import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class Demo7 {
    public static void main(String[] args) {
        //写文件操作
        //清空文件内容，写入文件
        //写在（）里，执行完毕后自动结束资源,仅仅支持流对象
        try(OutputStream outputStream = new FileOutputStream("./test.txt")) {
            outputStream.write(97);
            outputStream.write(98);
            outputStream.write(99);
            outputStream.write(100);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
